<template>
    <div id="tableBox">
        <el-table :data="props.tableData" id="table" stripe height="100%">
            <el-table-column v-for="(value, key) in props.tableStruct" :key="key" :prop="value.prop"
                :label="value.label" align="center"></el-table-column>
        </el-table>
    </div>

</template>

<script setup>
import { defineProps, } from 'vue'
/**
 * 表格数据结构：
 * tableStruct: [ { prop: 数据列名,label: 表头名},...]
 * tableData: [{数据列名:数据值},...]
 */
const props = defineProps(['tableData', 'tableStruct'])
</script>

<style lang="scss" scoped>
#tableBox {
    width: 100%;
    height: 100%;
    background-color: red;
}

#table {
    width: 100%;
}
</style>